#include "StdAfx.h"
#include "DxTexture.h"
#include "DxRenderer.h"
#include <D3dx9tex.h>

DxTexture::DxTexture(void)
{
	m_pTexture = NULL;
}


DxTexture::~DxTexture(void)
{
	if( m_pTexture )
		m_pTexture->Release();
}

void DxTexture::Load(const char* pszFile)
{
	if( FAILED(D3DXCreateTextureFromFile(DxRenderer::GetInstance()->GetDevice(), pszFile, (LPDIRECT3DTEXTURE9*)&m_pTexture)) )
		m_pTexture = NULL;
}